package com.project.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.project.entity.ProjectInfo;
import com.project.service.ProjectInfoService;
import com.project.service.Impl.ProjectInfoServiceImpl;

public class QueryByIdProServlet extends HttpServlet {
	ProjectInfoService impl = new ProjectInfoServiceImpl();
	protected void service(HttpServletRequest request, HttpServletResponse response) 
			throws ServletException, IOException {
		request.setCharacterEncoding("utf-8");
		response.setCharacterEncoding("utf-8");
		response.setContentType("text/html;charset=utf-8");
		int id = Integer.parseInt(request.getParameter("updateId")) ;
		ProjectInfo pro = new ProjectInfo();
		pro.setId(id);
		List<ProjectInfo> infos = impl.querytj(pro);
		for(ProjectInfo info:infos) {
			request.setAttribute("info", info);
		}
		request.getRequestDispatcher("gai.jsp").forward(request, response);
	}
}
